package cn.shadowsouls.system.bean.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 存放投票的内容即投票选项
 * @TableName vote_content
 */
@TableName(value ="vote_content")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VoteContent implements Serializable {
    /**
     * 
     */
    @TableId(value = "vc_id", type = IdType.AUTO)
    private Integer vcId;

    /**
     * 
     */
    @TableField(value = "vote_id")
    private Integer voteId;

    /**
     * 
     */
    @TableField(value = "option_name")
    private String optionName;

    /**
     * 
     */
    @TableField(value = "option_count")
    private Integer optionCount;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        VoteContent other = (VoteContent) that;
        return (this.getVcId() == null ? other.getVcId() == null : this.getVcId().equals(other.getVcId()))
            && (this.getVoteId() == null ? other.getVoteId() == null : this.getVoteId().equals(other.getVoteId()))
            && (this.getOptionName() == null ? other.getOptionName() == null : this.getOptionName().equals(other.getOptionName()))
            && (this.getOptionCount() == null ? other.getOptionCount() == null : this.getOptionCount().equals(other.getOptionCount()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getVcId() == null) ? 0 : getVcId().hashCode());
        result = prime * result + ((getVoteId() == null) ? 0 : getVoteId().hashCode());
        result = prime * result + ((getOptionName() == null) ? 0 : getOptionName().hashCode());
        result = prime * result + ((getOptionCount() == null) ? 0 : getOptionCount().hashCode());
        return result;
    }

    public VoteContent(Integer voteId, String optionName) {
        this.voteId = voteId;
        this.optionName = optionName;
    }
}